export const systemInfo = {
  data() {
    return {
      safeAreaHeight:0, // 苹果安全区域高度
      scrollHeight:800, // 窗口高度
      screenHeight:800,  // 屏幕高度
      statusBarHeight:20,  // 小程序顶部信号栏的高度
      isCheckIsWechatBrowser:false  ,// 是否在微信浏览器打开
			customHeight:0,
    }
  },
  onReady() {
    let that = this
    uni.getSystemInfo({
        success: function (res) {
          that.scrollHeight = res.windowHeight
          that.screenHeight = res.screenHeight
          that.statusBarHeight = res.statusBarHeight
          var height=0;
          if (res.platform=='ios') {
              if(res.safeArea.top > 20) { //x及以上的异形屏top为44，非异形屏为20
                  height+=res.safeArea.top;
              }
          }
          that.safeAreaHeight=height;
					// #ifdef MP-WEIXIN
					let custom = wx.getMenuButtonBoundingClientRect()
					that.customHeight = custom.height + 10
					// #endif
        }
    });
  },
}